#include"stdafx.h"
#ifdef LK_
namespace LK
{
	ptr<Exception>::ptr(ptr<String> description)throw() :ptr<Object>(new Exception(description)) {}
	ptr<Exception>::ptr(ptr<String> description, ptr<Exception> innerException)throw() :ptr<Object>(new Exception(description, innerException)) {}
	ptr<String> ptr<Exception>::GetDescription() const { return Check()->GetDescription(); }
	ptr<Exception> ptr<Exception>::GetInnerException() const { return Check()->GetInnerException(); }

	Exception::Exception(ptr<String> description)throw() :description(description), Inner() {}
	Exception::Exception() throw() :description(L"未知异常") {}
	Exception::Exception(const Exception& e)throw() :description(e.description), Inner(e.Inner) {}
	Exception::Exception(ptr<String> description, ptr<Exception> innerException)throw() :description(description), Inner(innerException) {}

	Exception::~Exception() {}

	ptr<String> Exception::GetDescription() { return description; }
	ptr<Exception> Exception::GetInnerException() { return Inner; }
	ptr<String> Exception::ToString()const { return description; }
	bool Exception::Equals(Object const&v)const { return CastPointer<Exception>(&v) != NULL; }


}
#endif